$(".project_nav1 p").on("click",function(){
	$(".content_mask").hide();
	$(this).addClass("pro_nav1active").siblings().removeClass("pro_nav1active");
	if($(this).index() == 0) {
		$(".project_index1,.project_index2,.project_index3,.project_nav3,.look_team,.look_project,.release_project").hide();
		$(".project_con1,.release_team").show();
	} else if($(this).index() == 1) {
		$(".project_index2,.project_index3,.project_nav3,.release_team,.look_team,.look_project").hide();
		$(".project_index1").show();
		$(".release_project").show();
	} else if($(this).index() == 2) {
		$(".project_index1,.project_index3,.project_nav3,.release_project,.release_team,.look_project").hide();
		$(".project_index2").show();
		$(".look_team").show();
	} else if($(this).index() == 3) {
		$(".project_index1,.project_index2,.project_nav3,.look_team,.release_team,.release_project").hide();
		$(".project_index3,.look_project").show();
		if($(".project_index3 p").hasClass("pro_nav2active")){
		}
	}
});
$(".project_nav2 p").each(function(){
	$(this).on("click",function(){
		$(this).addClass("pro_nav2active").siblings().removeClass("pro_nav2active");
		$(this).children().show();
		$(this).siblings().children().hide();
        var val=$(this).text();
        reList({chengshi:val,baild:1},1);
	});
	if($(this).hasClass("pro_nav2active")){
		$(this).find("i").show();
	};
});
$(".project_index1 p").on("click",function(){
	$('.release_project div.form_content').eq($(this).index()).show().siblings().hide();
});
$(".project_index2 p").on("click",function(){
	$('.look_team div.look_teams').eq($(this).index()).show().siblings().hide();
});
$(".project_index3 p").on("click",function(){
	$(".content_mask").show();
	if($(this).index() == 0) {
		$(".project_index11").show();
		$(".project_index21").hide();
	} else{
		$(".project_index21").show();
		$(".project_index11").hide();
	}
});
$(".project_index11 p").on("click",function(){
	$(".project_index3 p:first-child").text($(this).text());
	$(".project_index11,.content_mask").hide();
	$(".look_project").show();
    reList(quzhi(),2);
});
$(".project_index21 p").on("click",function(){
	$(".project_index3 p:last-child").text($(this).text());
	$(".project_index21,.content_mask").hide();
	$(".look_project").show();
    reList(quzhi(),2);
});
$(".upimg_box").on("click",function(){
	$(this).parents().find(".prompt").hide();
})

    var reList=function(djson,type){
     $.ajax({
        type: "post",
        url: "/index.php?g=Wechat&m=Webzhuan&a=xiangmufan",
        "contentType": "application/x-www-form-urlencoded; charset=utf-8",
        data:djson,
        dataType: "json",
        success: function (data ,textStatus, jqXHR)
        {
            if(data.length>0){
            var html=$("#chuzulist").html(),datas={
                data:data
            };
            var thtml=template(html,datas);
            $("#zulist"+type).html(thtml);
                }else{
               $("#zulist"+type).html("<div>暂无匹配数据</div>");     
                }
            
        },
        error:function (XMLHttpRequest, textStatus, errorThrown) {      
        }
     });
    };
var quzhi=function(){
    var json={},val=$(".project_index3 p:first-child").text();
    json["chengshi"]=$(".project_index3 p:last-child").text()=="区域"?null:$(".project_index3 p:last-child").text();
    json["build"]=2;
    switch(val){
        case "住宅":json["type"]=1;
            break;
         case "写字楼":json["type"]=2;
            break;
         case "商铺":json["type"]=3;
            break;
         case "车位":json["type"]=4;
            break;
        default:
            ""
        }
    return json;
}